package com.andnnl;

import java.io.File;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * Created by chenss on 2017/7/28.
 */
public class Test1 {
    public static void main(String[] args) {
        System.out.println(System.currentTimeMillis());

//        List<Integer> list111 = Stream.of(1, 2, 3, 4).collect(Collectors.toList());
        List<Integer> list111 = IntStream.range(0, 5).mapToObj(k -> Integer.valueOf(k)).collect(Collectors.toList());
        System.out.println(list111);
        list111.remove(0);
        list111.removeIf(i->i<3);
        System.out.println(list111);

        String a1="asdf";
        String a2="";
        System.out.println(a1.contains(a2));



        List<Integer> list = Arrays.asList(12, 5, 2, 1);
        list.stream().forEach(System.out::println);
        int value = Stream.of(1, 2, 3, 4).reduce(100, (sum, item) -> sum + item);
        System.out.println(value);
        int a = list.stream().reduce(10, (u, t) -> u + t);
        System.out.println(a);

        new Test1("sdf");
        File dir = new File("D:\\askdflkajdsf");
        System.out.println(dir);
        System.out.println(dir.listFiles());

        Date d1 = new Date(1590399759215L);
        Date d2 = new Date(1590401096058L);
        System.out.println(d1.toLocaleString());
        System.out.println(d2.toLocaleString());
        System.out.println(System.currentTimeMillis());


        int count = 12;
        int total = 22;
        int xx = (int) (count * 100 / total * 0.5);
        System.out.println(xx);

//        List<String> mobileSet = Arrays.asList("asdf","sdaf2");
        List<String> mobileSet = Arrays.asList();
        System.out.println("mo:"+mobileSet.stream().collect(Collectors.joining("','","'","'")));

        Map<String, List<String>>  namesMap=new HashMap<>();
        namesMap.put("asdf2",new ArrayList<>());
        updateSwitchConfig(namesMap);
        System.out.println(namesMap);
    }

    public Test1() {
        System.out.println("test1");
    }

    public Test1(String ss) {
        System.out.println("test2");
    }


    private static void updateSwitchConfig(Map<String, List<String>> namesMap) {
       namesMap=new HashMap<>();
        namesMap.put("asdf",new ArrayList<>());
        //多余的配置需要删除掉，与
    }

}
